home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / business / pdquot6a.zip / QUOTEDAT.EXE / CONVERT1.BAS < prev    next >
BASIC Source File  |  1994-10-28  |  1KB  |  28 lines

  1. 10 'Program CONVERT.BAS to add the decimal point to the US-04 file
  2. 20 KEY OFF:CLS:EA$="EA"
  3. 30 INPUT "Enter the Supplier Code to be added to each record";SUPPLIER$
  4. 40 'The above line for another customer that wanted to add a fixed Supplier Code
  5. 50 OPEN "A:PLUMDATAD" FOR INPUT AS #1
  6. 60 '     ^--- Type drive letter and colon (":") ahead of the input file name if the input file is in some other than the DOS default drive.
  7. 70 OPEN "PLUMDATA.PRN" FOR OUTPUT AS #2
  8. 80 '     ^-------^---- Name the output file anything you wish.
  9. 90 LINE INPUT #1, ITEM$  'Throw away the first line if it is a header
  10. 100 WHILE NOT EOF(1)
  11. 110    LINE INPUT #1, ITEM$
  12. 120    MATLCODE$ =  LEFT$(ITEM$,12)
  13. 130    PARTDESC$ =  MID$(ITEM$,14,30):Y = 0
  14. 140    X = INSTR(10,PARTDESC$," ") : IF X > 0 AND X <= 16 THEN Y = 1 : GOTO 180
  15. 150    X = INSTR(10,PARTDESC$,")") : IF X > 0 AND X <=16 THEN GOTO 180
  16. 160    X = INSTR(1,PARTDESC$," ") : IF X > 0 AND X <=16 THEN Y = 1 : GOTO 180
  17. 170    X = 16
  18. 180    PARTNUM$ = LEFT$(PARTDESC$,X - Y):DESCRIPT$ = MID$(PARTDESC$,X+1)
  19. 190    DESCRIPT$ = MID$(PARTDESC$,X+1)
  20. 200    UNITPRICE$ =  MID$(ITEM$,58,7)
  21. 210    UNITPRICE = VAL(UNITPRICE$)/100  'Convert to numeric variable
  22. 220    WRITE #2, MATLCODE$;PARTNUM$;DESCRIPT$;UNITPRICE;SUPPLIER$;EA$
  23. 230    PRINT MATLCODE$;TAB(14);PARTNUM$;TAB(33);DESCRIPT$;TAB(60);UNITPRICE;TAB(72)SUPPLIER$
  24. 240 WEND
  25. 250 CLOSE #1
  26. 260 CLOSE #2
  27. 270 SYSTEM
  28.